<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>用户信息管理系统</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">
    <script src="js/jquery-2.1.0.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <style type="text/css">
        td, th {
            text-align: center;
        }
    </style>
</head>
<body>
<div class="container">
    <h3 style="text-align: center">商品信息列表</h3>
    <table border="1" class="table table-bordered table-hover">
        <tr class="success">
            <th>编号</th>
            <th>商品名称</th>
            <th>价格</th>
            <th>入库时间</th>
            <th>商品分类</th>
        </tr>
        <c:forEach items="${pageBean.productList}" var="pro">
            <tr>
                <td>${pro.id}</td>
                <td>${pro.name}</td>
                <td>${pro.sex}</td>
                <td>${pro.age}</td>
                <td>${pro.address}</td>

            </tr>
        </c:forEach>


        <tr>
            <td colspan="5" align="center">
                <nav aria-label="Page navigation">
                    <ul class="pagination">
                        <c:if test="${pageBean.pageNumber>1}">
                        <li>
                            <a href="queryPage?pageNumber=1&pageSize=20" aria-label="Previous">
                                <span aria-hidden="true">首页</span>
                            </a>
                        </li>
                        <li>
                            <a href="queryPage?pageNumber=${pageBean.pageNumber-1}&pageSize=20" aria-label="Previous">
                                <span aria-hidden="true">上一页</span>
                            </a>
                        </li>
                        </c:if>
                            <c:forEach var="i" begin="1" end="${pageBean.pageCount}" step="1">
                                <li class="${pageBean.pageNumber==i?"active":""}">
                                    <a href="queryPage?pageNumber=${i}&pageSize=20">${i}</a></li>

                            </c:forEach>


                            <c:if test="${pageBean.pageNumber<pageBean.pageCount}">
                        <li>
                            <a href="queryPage?pageNumber=${pageBean.pageNumber+1}&pageSize=20" aria-label="Next">
                                <span aria-hidden="true">下一页</span>
                            </a>
                        </li>
                        <li>
                            <a href="queryPage?pageNumber=${pageBean.pageCount}&pageSize=20" aria-label="Next">
                                <span aria-hidden="true">末页</span>
                            </a>
                        </li>
                            </c:if>
                    </ul>
                </nav>
            </td>
        </tr>
    </table>
</div>
</body>
</html>
